Where(TSource) Method (ParallelQuery(TSource), Func(TSource, Int32, Boolean))

Task Parallel System.Threading

Filters in parallel a sequence of values based on a predicate. Each element's index is used in the logic of the predicate function.

Namespace:  System.Linq
Assembly:  System.Threading (in System.Threading.dll)

Syntax

Visual Basic (Declaration)
Public Shared Function Where(Of TSource) ( _
	source As ParallelQuery(Of TSource), _
	predicate As Func(Of TSource, Integer, Boolean) _
) As ParallelQuery(Of TSource)
C#
public static ParallelQuery<TSource> Where<TSource>(
	ParallelQuery<TSource> source,
	Func<TSource, int, bool> predicate
)

Parameters

source
Type: System.Linq..::.ParallelQuery<(Of <(TSource>)>)
A sequence to filter.
predicate
Type: System..::.Func<(Of <(TSource, Int32, Boolean>)>)
A function to test each element for a condition.

Type Parameters

TSource
The type of the elements of source.

Return Value

A sequence that contains elements from the input sequence that satisfy the condition.

Exceptions

ExceptionCondition
System..::.ArgumentNullException source or predicate is a null reference (Nothing in Visual Basic).

See Also